﻿Imports DAO
Imports DTO
Public Class BoPhanBUS
    Public Shared Function LayDanhSachBoPhan() As DataTable
        Return BoPhanDAO.LayDanhSachBoPhan()
    End Function

    Public Shared Function LayDanhSachBoPhanCBX() As DataTable
        Return BoPhanDAO.LayDanhSachBoPhanCBX()
    End Function

    Public Shared Function ThemBoPhan(BoPhanDTO As BoPhanDTO) As Boolean
        Dim kq As Boolean = True
        If BoPhanDTO.TenBoPhan.Length < 1 Then
            Return False
        End If
        BoPhanDAO.ThemBoPhan(BoPhanDTO)
        Return kq
    End Function

    Public Shared Function CapNhapBoPhan(BoPhanDTO As BoPhanDTO) As Boolean
        Dim kq As Boolean = True
        If BoPhanDTO.TenBoPhan.Length < 1 Then
            Return False
        End If
        BoPhanDAO.CapNhapBoPhan(BoPhanDTO)
        Return kq
    End Function

    Public Shared Function XoaBoPhan(BoPhanDTO As BoPhanDTO) As Boolean
        Dim kq As Boolean = True
        If BoPhanDTO.MaBoPhan.Length < 1 Then
            Return False
        End If
        BoPhanDAO.XoaBoPhan(BoPhanDTO)
        Return kq
    End Function

    Public Shared DongKetNoi As System.Data.SqlClient.SqlConnection = CKetNoi.Connect

End Class
